#!/usr/bin/env python3
# -*- coding: utf-8 -*-

names = ['Michael', 'Bob', 'Tracy']
for name in names:
    print(name)

sum = 0
for x in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]:
    sum = sum + x
print(sum)
# range()函数，可以生成一个整数序列,range(5)生成的序列是从0开始小于5的整数[0, 1, 2, 3, 4]
sum = 0
for x in range(101):
    sum = sum + x
print(sum)

# while
sum = 0
n = 4
while n > 0:
    sum = sum + n
    n = n - 2
print(sum)
